import axios from 'axios'

//导入进度条插件
import NProgress from 'nprogress'
//导入进度条样式
import 'nprogress/nprogress.css'

const request = axios.create({
    baseURL: 'https://www.liulongbin.top:8888/api/private/v1/'
})
request.interceptors.request.use(config => {
    //当进入request拦截器，表示发送了请求，我们就开启进度条
    NProgress.start()
    config.headers.Authorization = window.sessionStorage.getItem('token')
    // 在最后必须return
    return config
})
export default request